angular.module('app')
    .directive('loading', [function() {
        return {
            restrict: 'E',
            templateUrl:'tpl/loading/loading.html',
            replace:true
        };
    }])
    .directive('circleLoading', [function() {
        return {
            restrict: 'E',
            templateUrl:'tpl/loading/circle_loading.html',
            replace:true
        };
    }]);


app.directive('errSrc', function() {
    return {
        link: function(scope, element, attrs) {
            element.bind('error', function() {
                if (attrs.src != attrs.errSrc) {
                    console.log(attrs.errSrc);

                    attrs.$set('src', attrs.errSrc);
                }
            });
        }
    }
});